import type { FC } from 'react';
import style from './index.less';
import React, { Fragment, useState, useEffect } from 'react';
import { getCommunity } from './service';
import { Avatar, Button, Popover, Tag } from 'antd';
import { Link } from 'umi';
import IconFont from '@/components/Icon';
import { GithubOutlined } from '@ant-design/icons';
import Count from '../Count';
import { iteratee } from 'lodash';
import { Item } from 'gg-editor';

interface Props {}

const YouPraise: FC<Props> = () => {
  const [article, setArticle] = useState([]);
  const getArticle = () => {
    getCommunity({ user_id: localStorage.getItem('user_id') }).then(res => {
      console.log(res.data)
      setArticle(res.data);
    });
  };

  useEffect(() => {
    getArticle();
  }, []);
  //取消关注接口
  function getDeletFollow(){
    console.log('我取消了')
  }
  return (
    <div className={style.container}>
      {article.map((item, index) => (
        <div className={style.card}>
          <div className={style.talkName}>
            社区名称：{item.column}
          </div>
          <div className={style.talkButton}>
            <Button type='primary' style={{float:'right'}} onClick={
              ()=>{getDeletFollow()}
            }>-取消关注</Button>
          </div>
        </div>
      ))}
    </div>
  );
};

export default YouPraise;
